import Vue from "vue";
import App from "./App.vue";
// 引入ElementUI,ElementUI样式
import ElementUI from "element-ui";
import "element-ui/lib/theme-chalk/index.css";
import router from "@/router";
// 引入三级联动组件---注册为全局组件
import TypeNav from "@/components/TypeNav/index.vue";
import Carousel from "@/components/Carousel/index.vue";
import Pagination from "@/components/Pagination/index.vue";
//引入仓库
import store from "@/store";
//引入模拟的数据
import "@/mock/mockServer.js";
//引入轮播图样式
import "swiper/css/swiper.css";
//引入懒加载
import VueLazyload from "vue-lazyload";
//引入默认加载图片
const loadimage = require("./assets/images/loading.gif");
//注册全局组件
Vue.component(TypeNav.name, TypeNav);
Vue.component(Carousel.name, Carousel);
Vue.component(Pagination.name, Pagination);
// 使用ElementUI
Vue.use(ElementUI);
//注册懒加载
Vue.use(VueLazyload, {
  loading: loadimage,
});
Vue.config.productionTip = false;
new Vue({
  //注册路由
  router,
  //全局时间总线$bus配置
  beforeCreate() {
    Vue.prototype.$bus = this;
  },
  store,
  render: (h) => h(App),
}).$mount("#app");
